package com.cjm.one.security.custom;

import com.cjm.one.model.custom.entity.CustomerInfo;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.ArrayList;
import java.util.Collection;

public class AppCustomer extends User implements java.io.Serializable {
    private CustomerInfo customerInfo;
    public AppCustomer() {
        super("", "", new ArrayList<>());
        // 默认构造方法，可以初始化一些默认值或保持为空
    }
    public AppCustomer(CustomerInfo customerInfo) {
        super(customerInfo.getEmail(), customerInfo.getPassword(), new ArrayList<>());
        this.customerInfo = customerInfo;
    }

    public AppCustomer(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public CustomerInfo getCustomerInfo() {
        return customerInfo;
    }

    public void setCustomerInfo(CustomerInfo customerInfo) {
        this.customerInfo = customerInfo;
    }
}
